﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  
  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <title>人马君</title>
</head>
<body>

  <div class="page-group">
    <div class="page page-current">
    
      <header class="bar student-bar">
        <a href="${ctx.host}" class="icon icon-left pull-left back"></a>
        <h1 class="student-title">学员课件</h1>
      </header>
      
      <div class="bar bar-header-secondary  bar-tab">
         <a class="tab-item student external fs-tab" href="${ctx.host}/rounds?type=GROUPING">待分组</a>
         <a class="tab-item student external fs-tab" href="${ctx.host}/rounds?type=EDITING">编辑中</a>
         <a class="tab-item student external fs-tab" href="${ctx.host}/rounds?type=FINISH">已完成</a>
         <a class="tab-item student external fs-tab active" href="${ctx.host}/rounds?type=CANCEL">已取消</a>
      </div>
      
      <div class="content">
      
        <c:if test="${empty courseRounds}">
          <div class="list-block media-list" style="margin-top:1.2rem">
            <p class="text-center">暂无已取消课程的学员</p>
          </div>          
        </c:if>
        
        <c:if test="${not empty courseRounds}">
          <div class="list-block media-list" style="margin-top:1.2rem">
            <ul>
            <c:forEach var="courseRound" items="${courseRounds}">
              <a href="${ctx.host}/rounds/${courseRound.id}?type=${courseRound.roundCoursewareStatus}" class="item-content student item-link">
              
	              <div class="item-media">
	                <img src="${cloud.prod}/${courseRound.course.cover}" style='width: 4rem;'>
	              </div>
	              
	              <div class="item-inner">
	                <div class="item-title-row">
	                  <div class="item-title">${courseRound.student.name}<small class="color-gray">&nbsp;${courseRound.student.mobile}</small></div>
	                  <div class="item-after">${courseRound.fitnessGroup.name}</div>
	                </div>
	                
	                <div class="item-subtitle" style="margin: .2rem 0;">
	                  
	                  <span class="course-title individual-course">${courseRound.course.name}
	                    <small>（${courseRound.course.hours}课时）</small>
	                  </span>
	                  <br>课程课时：已上${courseRound.finished}节，余${courseRound.attrs['course_amount'].value == null ? (courseRound.course.hours - courseRound.finished) : (courseRound.attrs['course_amount'].value - courseRound.finished)}节
	                  <br>课时课件：已排${courseRound.plannedCourse}节，余${courseRound.attrs['courseware_class_amount'].value - courseRound.plannedCourse}节
	                  <br>周计划：已排${courseRound.plannedWeekly > courseRound.attrs['courseware_weekly_amount'].value ? courseRound.attrs['courseware_weekly_amount'].value : courseRound.plannedWeekly}周，余${(courseRound.attrs['courseware_weekly_amount'].value <= courseRound.plannedWeekly) ? 0 : (courseRound.attrs['courseware_weekly_amount'].value - courseRound.plannedWeekly)}周

	                  <c:if test="${(courseRound.attrs['course_amount'].value - courseRound.finished) < 3 and courseRound.courseType.year}">
	                    <br><small class="color-danger">当前未上课上课课件小于3节，请及时排课。</small>
	                  </c:if>
	                  
	                </div>
	              </div>
	              
              </a>
            </c:forEach>
          </ul>
          </div>   
        </c:if>
        
      </div>
      
    </div>
  </div>
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  
</body>
</html>